<template>
  <div>
    <div style="width: 100%;text-align: right">
      <el-button size="mini" type="primary">
        <i class="el-icon-upload"/>
        上传
      </el-button>
    </div>
    <el-table :data="fileList" v-loading="loading" style="width: 100%;margin-top: 8px">
      <el-table-column show-overflow-tooltip align="center" min-width="155" label="附件名称" prop="date"/>
      <el-table-column show-overflow-tooltip align="center" min-width="115" label="附件大小" prop="name"/>
      <el-table-column show-overflow-tooltip align="center" min-width="135" label="上传人" prop="name"/>
      <el-table-column show-overflow-tooltip align="center" min-width="175" label="上传时间" prop="name"/>
      <el-table-column show-overflow-tooltip align="center" min-width="155" label="来源" prop="name"/>
      <el-table-column show-overflow-tooltip align="center" min-width="175" label="操作" prop="name">
        <template scope="scope">
          <el-button type="text" @click="fileRemoveHandler(scope.row.id)">移除</el-button>
          <el-button type="text" @click="fileDownloadHandler(scope.row.id)">下载</el-button>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
export default {
  name: 'FileTable',
  components: {},
  props: {
    fileList: {
      type: Array
    },
    loading: {
      type: Boolean,
      default: true
    }
  },
  data() {
    return {}
  },
  // 在实例创建完成后被立即调用
  created() {

  },
  // 实例被挂在后调用
  mounted() {

  },
  // 方法
  methods: {
    fileRemoveHandler(fileId) {
      this.$emit('removeFile', fileId)
    },
    fileDownloadHandler() {

    }
  }
}
</script>

<style scoped>

</style>
